//
//  CMViewController.m
//  CraneMachine
//
//  Created by ice on 2017/10/30.
//  Copyright © 2017年 ICE. All rights reserved.
//

#import "CMViewController.h"
#import <Toast/UIView+Toast.h>

@interface CMViewController ()

@end

@implementation CMViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)showToast:(NSString *)text {
    
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self.view.window != nil) {
            [self.view endEditing:YES];
            [self.view.window makeToast:text duration:1.5 position:CSToastPositionBottom];
        }
    });
}

@end
